package com.imau.controller;

import com.imau.bean.Book;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/books")
public class BookController {

//    @Value("${jdbc.driver}")
//    private String driverName;
//    @Value("${jdbc.url}")
//    private String url;
//    @Value("${jdbc.username}")
//    private String userName;
//    @Value("${jdbc.password}")
//    private String password;
    @GetMapping("/{id}")
    public Book findBookById(@PathVariable Integer id)
    {

//        System.out.println("driverName="+driverName);
//        System.out.println("url="+url);
//        System.out.println("userName="+userName);
//        System.out.println("password="+password);
        Book book = new Book();
        book.setId(1);
        book.setName("javaEE");
        book.setType("计算机理论");
        book.setDescription("111111111111111111111111");
        return book;
    }

}
